package com.tomtop.core._enum;

public enum CustomStatus {
	OK(LogLevel.DEBUG,200,"ok","响应成功"),
	FAIL(LogLevel.ERROR,500,"fail","操作失败"), 
	UPDATE_REDIS_FAIL(550,"","redis提交事务失败"),
	PAGE_NOT_FOUND(LogLevel.INFO,404,"Page Not Found.","请求资源不存在"),
	DO_REQUEST_WAIT_CACHE_RESULT_TIMEOUT(700,"service request timeout","等待请求结果超时"),
	DO_REQUEST_DESERIALIZATION_FAIL(701,"service response deserialization fail","发请求，结果集转化为json失败"), 
	USER_NO_LOGIN(800,"user no login","用户未登录"), 

	;
	public static enum LogLevel{OFF,ERROR,WARN,INFO,DEBUG,TRACE;}
	private String message,cnMessage,goUrl;
	private int code;
	private LogLevel level;
	CustomStatus(int code,String message){
		this.message=message;
		this.code=code;
		this.level=LogLevel.WARN;
	}
	CustomStatus(int code,String message,String cnMessage){
		this(code, message);
		this.cnMessage=cnMessage;
	}
	CustomStatus(int code,String message,String cnMessage,String goUrl){
		this(code, message, cnMessage);
		this.goUrl=goUrl;
	}
	CustomStatus(LogLevel level,int code,String message){
		this.message=message;
		this.code=code;
		this.level=level;
	}
	CustomStatus(LogLevel level,int code,String message,String cnMessage){
		this(level,code, message);
		this.cnMessage=cnMessage;
	}
	CustomStatus(LogLevel level,int code,String message,String cnMessage,String goUrl){
		this(level,code, message, cnMessage);
		this.goUrl=goUrl;
	}
	public String getGoUrl() {
		return goUrl;
	}
	public String message(){
		return this.message;
	}
	public int code(){
		return this.code;
	}
	public String cnMessage() {
		return this.cnMessage;
	}
	public LogLevel getLevel() {
		return level;
	}
}
